package com.morristaedt.mirror.modules.voice.handler;

import com.google.gson.GsonBuilder;
import com.morristaedt.mirror.bean.SemanticResult;
import com.morristaedt.mirror.bean.Weather;

/**
 * Created by PR on 2018/1/30.
 */

public class WeatherHandler extends Handler {
    public WeatherHandler(SemanticResult result) {
        super(result);
    }

    @Override
    public String getFormatContent() {
           return result.answer;
    }

    public Object getDetail(){
        try {
            return new GsonBuilder().create().fromJson(result.data.toString(),Weather.class);
        }catch (Exception e ){
            return result.answer;
        }
    }
}
